package com.zhwmall.common.feign;


import com.zhwmall.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;


/**
 * @author:yanjizhw@163.com
 * @date:2020/8/20 9:57
 * 描述:
 * @since:1.0.0
 */
@FeignClient(name = "zhwmall-product", fallback = CategoryFeignService.CategoryFeignServiceFallback.class)
public interface CategoryFeignService {

    @RequestMapping("product/category/list")
    R list(@RequestParam Map<String, Object> params);

    //请求不到,则转入降级
    @Component
    class CategoryFeignServiceFallback implements CategoryFeignService {

        @Override
        public R list(Map<String, Object> params) {
            return null;
        }
    }
}
